home *** CD-ROM | disk | FTP | other *** search
- PROGRAM make_data;
-
- { Create a data file of RECORDs }
-
- CONST
- {$I gemconst.pas}
-
- TYPE
- {$I gemtype.pas}
-
- rating = ( chief, cook, bottle_washer );
-
- info = record
- name : string [30];
- rank : rating;
- end; {info definition}
-
- VAR
- myfile : file of INFO;
- myrec : info;
- iloop : integer;
-
- {$I gemsubs.pas}
-
- BEGIN
- IF Init_Gem >= 0 THEN
- BEGIN
- Rewrite( myfile, 'A:\INFO.DAT' );
- FOR iloop := 1 to 3 DO
- BEGIN
- Write( 'Name: ');
- Readln( myrec.name );
- CASE iloop OF
- 1 : myrec.rank := chief;
- 2 : myrec.rank := cook;
- 3 : myrec.rank := bottle_washer;
- END; {case}
- myfile^ := myrec;
- Put( myfile );
- END;
- Close( myfile );
- END;
- Exit_Gem;
- END.
-